package com.igeek.shop.web.product;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.igeek.shop.entity.Product;
import com.igeek.shop.service.product.ProductService;
import com.igeek.shop.service.product.ProductServiceImp;




public class ProductServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private ProductService ps  = new ProductServiceImp(); 
 
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Product> productList = ps.getProductList();
		request.getSession().setAttribute("productList", productList);
		response.sendRedirect(request.getContextPath()+"/product_list.jsp");
		
		
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
